package com.munhrasoft.dinamica.business.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;

@Entity
@NamedQueries(value = { @NamedQuery(name = "findAllAuthUsr", query = "SELECT u FROM UserEntity u") })
@SequenceGenerator(name = "userEntitySeq", initialValue = 1, allocationSize = 1)
public class UserEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "userEntitySeq")
    private Long        id_usuario;

    @Id
    @Column(name = "name", length = 20)
    private String      itsName;

    @Column(name = "password", length = 1024)
    private String      itsPassword;

    private String      nomeUsuario;
    private String      email;
    private String      endereco;
    private String      celular;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "groupName", referencedColumnName = "name")
    private GroupEntity itsGroupEntity;

    public Long getId_usuario() {
        return id_usuario;
    }

    public void setId_usuario(Long id_usuario) {
        this.id_usuario = id_usuario;
    }

    public String getItsName() {
        return itsName;
    }

    public void setItsName(String itsName) {
        this.itsName = itsName;
    }

    public String getItsPassword() {
        return itsPassword;
    }

    public void setItsPassword(String itsPassword) {
        this.itsPassword = itsPassword;
    }

    public GroupEntity getItsGroupEntity() {
        return itsGroupEntity;
    }

    public void setItsGroupEntity(GroupEntity itsGroupEntity) {
        this.itsGroupEntity = itsGroupEntity;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEndereco() {
        return endereco;
    }

    public void setEndereco(String endereco) {
        this.endereco = endereco;
    }

    public String getCelular() {
        return celular;
    }

    public void setCelular(String celular) {
        this.celular = celular;
    }

    public String getNomeUsuario() {
        return nomeUsuario;
    }

    public void setNomeUsuario(String nomeUsuario) {
        this.nomeUsuario = nomeUsuario;
    }

}
